package com.bean;

import com.utils.DateUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Administrator
 */
public class Notice {
    private Integer id;

    private Integer adminId;

    private String adminName;

    private String title;

    private String content;

    private String createTime;

    public Notice() {
    }

    public Notice(Integer adminId, String title, String content, Date createTime) {
        this.adminId = adminId;
        this.title = title;
        this.content = content;
        if (createTime == null) {
            this.createTime = null;
        } else {
            this.createTime = DateUtils.format(createTime);
        }
    }

    @Override
    public String toString() {
        return "Notice{" +
                "id=" + id +
                ", adminId=" + adminId +
                ", adminName='" + adminName + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                '}';
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAdminId() {
        return adminId;
    }

    public void setAdminId(Integer adminId) {
        this.adminId = adminId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        if (createTime == null) {
            return null;
        } else {
            return DateUtils.parse(createTime);
        }
    }

    public void setCreateTime(Date createTime) {
        if (createTime == null) {
            this.createTime = null;
        } else {
            this.createTime = DateUtils.format(createTime);
        }
    }
}